package com.xzh.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xzh.entity.CarHistory;
import com.xzh.mapper.HistoryMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HistoryService {
    @Resource
    private HistoryMapper historymapper;

    public PageInfo<CarHistory> selectPage(CarHistory e, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<CarHistory> list = historymapper.selectALL(e);
        return PageInfo.of(list);
    }

    public void add(CarHistory e) {
        historymapper.add(e);
    }
}
